﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GmepCommonData.h"
#include "IGmepPropertyInfo.h"
#include <map>

namespace gmep
{
    // Disciplines,categories and classes read from MDMCategory.qpd
    // 

    class GMEP_COMMONDATA_EXPORT IGmepCategoryInfo
    {
    public:        
        virtual ~IGmepCategoryInfo() {};
        static gcmp::OwnerPtr<gmep::IGmepCategoryInfo>  Create();

        virtual int GetOrder() const = 0;
        virtual void SetOrder(const int order) = 0;

        virtual std::wstring GetId() const = 0;
        virtual void SetId(const std::wstring& sid) = 0;

        virtual std::wstring GetMappedId() const = 0;
        virtual void SetMappedId(const std::wstring& sid) = 0;

        virtual std::wstring GetStandardCode() const = 0;
        virtual void SetStandardCode(const std::wstring& sid) = 0;

        // guid string of parent  // todo 
        virtual std::wstring GetParentId() const = 0;
        virtual void SetParentId(const std::wstring& sid) = 0;
        //  
        virtual std::wstring GetCode() const = 0;
        virtual void SetCode(const std::wstring& code) = 0;

        // local name
        virtual const std::wstring GetName() const = 0;
        virtual void SetName(const std::wstring& name) = 0;
        // local description
        virtual const std::wstring GetDesc() const = 0;
        virtual void SetDesc(const std::wstring& desc) = 0;

        virtual void AddCategoryInfo(gcmp::OwnerPtr<IGmepCategoryInfo> category) = 0;
        virtual std::map<std::wstring, const gmep::IGmepCategoryInfo *> GetCategoryInfoList() const = 0;
        // 获取子分类的ownerptr, 慎用
        virtual std::map<std::wstring, gcmp::OwnerPtr<gmep::IGmepCategoryInfo >> GetCategoryInfoOwnerPtrList() = 0;

        virtual void AddPropertyInfo(gcmp::OwnerPtr<IGmepPropertyInfo> prop) = 0;
        // 获取该类别下 所有属性: 返回 id->属性 的map
        virtual std::map<std::wstring, const IGmepPropertyInfo *>  GetPropertyInfoList() const = 0;
        // 获取该类别下 指定标准编码的 属性
        virtual const gmep::IGmepPropertyInfo * GetPropertyInforByStandardCode(const std::wstring stdCode) const = 0;

        virtual bool GetTechnicalCurve() const = 0;
        virtual void SetTechnicalCurve(bool hasTechnicalCurve) = 0;

        virtual bool GetComputeSpecification() const = 0;
        virtual void SetComputeSpecification(bool hasComputeSpecification) = 0;
    };

    class GMEP_COMMONDATA_EXPORT IGmepDisciplineInfo
    {
    public:        
        virtual ~IGmepDisciplineInfo() {};
        static gcmp::OwnerPtr<gmep::IGmepDisciplineInfo>  Create();

        virtual int GetOrder() const = 0;
        virtual void SetOrder(const int order) = 0;

        virtual std::wstring GetId() const = 0;
        virtual void SetId(const std::wstring& sid) = 0;

        // local name
        virtual const std::wstring GetName() const = 0;
        virtual void SetName(const std::wstring& name) = 0;
        // local description
        virtual const std::wstring GetDesc() const = 0;
        virtual void SetDesc(const std::wstring& desc) = 0;

        virtual void AddCategoryInfo(gcmp::OwnerPtr<IGmepCategoryInfo> cate) = 0;
        virtual std::map<std::wstring, const IGmepCategoryInfo *>  GetCategoryInfoList() const = 0;
        virtual std::map<std::wstring, gcmp::OwnerPtr<gmep::IGmepCategoryInfo >> GetCategoryInfoOwnerPtrList() = 0;

        virtual std::wstring GetCode() const = 0;
        virtual   void SetCode(const std::wstring& code) = 0;

        // 标准码
        virtual std::wstring GetStandardCode() const = 0;
        virtual void SetStandardCode(const std::wstring& sCode) = 0;

    };
}